#include "TextManager.h"

TextManager::TextManager() {
    Initialize();
}

TextManager::~TextManager() {
}

void TextManager::Initialize() {
    AddFont("assets/fonts/Chelsea.ttf");
}

/**
 * Do not currently have a vector of Fonts,
 * currently just sets the one font.
 * */
void TextManager::AddFont(const string& relPath) {
    if (!primaryFont.LoadFromFile(relPath)) {
        cerr << "Error loading in font " << relPath << endl;
    } else {
        cout << "Loaded in font " << relPath << " successfully!" << endl;
    }
}

void TextManager::DisplayText(RenderWindow& buffer, const string& text, float x, float y) {
    String str(text, primaryFont, 24);

    str.SetColor(Color(0, 0, 0));
    str.Move(x, y);

    buffer.Draw(str);
}




